/*
 * @Description: ESP8266作为STATION模式 <.h头文件>
 * @Autor: 唐京伟
 */

#ifndef _ESP8266_STA_H_
#define _ESP8266_STA_H_

#include "usart1.h"
#include "usart2.h"
#include "string.h"
#include "stdio.h"

// esp8266 引脚
#define WIFI_RESET_GPIO_Port GPIOB
#define WIFI_RESET_Pin GPIO_Pin_3

/* esp8266 对应的串口 */
#define wifiUsart huart4
#define wifiInterrupt UART4
/* 中断接收所用变量 */
#define rx_rxBUFF_SIZE 2048

extern uint16_t rxCount;
extern char rxBuff[rx_rxBUFF_SIZE];   //缓冲区
extern char config_success;
extern uint8_t rxBuffer;
extern char config_success;

void wifi_sendMessage(char *cmd);							//发送数据
uint8_t wifi_sendCmd(char *cmd,int timeout);	//发送命令
uint8_t wifi_reset(int timeout);							//wifi复位
uint8_t wifi_config_STA(void);								//STATION模式配置

#endif
